[EAGLE-7083]: Add retry logic to OpenAI API calls#878
Merged
patricklundquist merged 5 commits intomasterfrom Jan 9, 2026
Merged
[EAGLE-7083]: Add retry logic to OpenAI API calls#878patricklundquist merged 5 commits intomasterfrom
patricklundquist merged 5 commits intomasterfrom
Conversation
Implements an automatic retry mechanism for OpenAI API calls to handle transient `httpx.ConnectError` exceptions. - Adds `tenacity` as a dependency. - Wraps all OpenAI API calls in `OpenAIModelClass` with a `@retry` decorator. - Configures the retry to happen up to 3 times with exponential backoff on `httpx.ConnectError`.
Contributor
Author
|
@copilot, fix tests |
Contributor
|
@patricklundquist I've opened a new pull request, #879, to work on those changes. Once the pull request is ready, I'll request review from you. |
…879) * Initial plan * Fix tests: Add missing mock methods to MockOpenAIClient Add models.list(), images.generate(), and embeddings.create() mock methods to MockOpenAIClient to support the retry logic that was added to OpenAIModelClass. Co-authored-by: patricklundquist <1460278+patricklundquist@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: patricklundquist <1460278+patricklundquist@users.noreply.github.com>
Contributor
Author
|
@copilot fix per the build test failures |
Contributor
|
@patricklundquist I've opened a new pull request, #894, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Add httpx dependency for retry logic httpx is imported in openai_class.py for ConnectError exception but was missing from requirements.txt. This was causing import failures during tests. Co-authored-by: patricklundquist <1460278+patricklundquist@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: patricklundquist <1460278+patricklundquist@users.noreply.github.com>
Minimum allowed line rate is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements an automatic retry mechanism for OpenAI API calls to handle transient
httpx.ConnectErrorexceptions.tenacityas a dependency.OpenAIModelClasswith a@retrydecorator.httpx.ConnectError.